import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/cateslide_group_entity.dart';
import 'package:cbec_app/entity/home/content/content_data.dart';

CateslideGroupEntity $CateslideGroupEntityFromJson(Map<String, dynamic> json) {
  final CateslideGroupEntity cateslideGroupEntity = CateslideGroupEntity();
  final String? titleColor2 = jsonConvert.convert<String>(json['title_color2']);
  if (titleColor2 != null) {
    cateslideGroupEntity.titleColor2 = titleColor2;
  }
  final int? goodsLr = jsonConvert.convert<int>(json['goods_lr']);
  if (goodsLr != null) {
    cateslideGroupEntity.goodsLr = goodsLr;
  }
  final String? displayScale = jsonConvert.convert<String>(json['display_scale']);
  if (displayScale != null) {
    cateslideGroupEntity.displayScale = displayScale;
  }
  final int? rdx = jsonConvert.convert<int>(json['rdx']);
  if (rdx != null) {
    cateslideGroupEntity.rdx = rdx;
  }
  final String? textAlignType = jsonConvert.convert<String>(json['text_align_type']);
  if (textAlignType != null) {
    cateslideGroupEntity.textAlignType = textAlignType;
  }
  final CateslideGroupBgImage? bgImage = jsonConvert.convert<CateslideGroupBgImage>(json['bg_image']);
  if (bgImage != null) {
    cateslideGroupEntity.bgImage = bgImage;
  }
  final String? uuid = jsonConvert.convert<String>(json['uuid']);
  if (uuid != null) {
    cateslideGroupEntity.uuid = uuid;
  }
  final String? bgColor2 = jsonConvert.convert<String>(json['bg_color2']);
  if (bgColor2 != null) {
    cateslideGroupEntity.bgColor2 = bgColor2;
  }
  final String? txtMod2 = jsonConvert.convert<String>(json['txt_mod_2']);
  if (txtMod2 != null) {
    cateslideGroupEntity.txtMod2 = txtMod2;
  }
  final String? txtMod1 = jsonConvert.convert<String>(json['txt_mod_1']);
  if (txtMod1 != null) {
    cateslideGroupEntity.txtMod1 = txtMod1;
  }
  final int? pageMarginRight = jsonConvert.convert<int>(json['page_margin_right']);
  if (pageMarginRight != null) {
    cateslideGroupEntity.pageMarginRight = pageMarginRight;
  }
  final int? goodsInerlr = jsonConvert.convert<int>(json['goods_inerlr']);
  if (goodsInerlr != null) {
    cateslideGroupEntity.goodsInerlr = goodsInerlr;
  }
  final List<CateslideGroupSubEntry>? subEntry = (json['sub_entry'] as List<dynamic>?)?.map((e) => jsonConvert.convert<CateslideGroupSubEntry>(e) as CateslideGroupSubEntry).toList();
  if (subEntry != null) {
    cateslideGroupEntity.subEntry = subEntry;
  }
  final int? per = jsonConvert.convert<int>(json['per']);
  if (per != null) {
    cateslideGroupEntity.per = per;
  }
  final int? sizeA = jsonConvert.convert<int>(json['size_a']);
  if (sizeA != null) {
    cateslideGroupEntity.sizeA = sizeA;
  }
  final int? pageMarginBottom = jsonConvert.convert<int>(json['page_margin_bottom']);
  if (pageMarginBottom != null) {
    cateslideGroupEntity.pageMarginBottom = pageMarginBottom;
  }
  final String? titleBgcolor = jsonConvert.convert<String>(json['title_bgcolor']);
  if (titleBgcolor != null) {
    cateslideGroupEntity.titleBgcolor = titleBgcolor;
  }
  final int? imgw = jsonConvert.convert<int>(json['imgw']);
  if (imgw != null) {
    cateslideGroupEntity.imgw = imgw;
  }
  final int? subA = jsonConvert.convert<int>(json['sub_a']);
  if (subA != null) {
    cateslideGroupEntity.subA = subA;
  }
  final String? borderRadiusType = jsonConvert.convert<String>(json['border_radius_type']);
  if (borderRadiusType != null) {
    cateslideGroupEntity.borderRadiusType = borderRadiusType;
  }
  final int? goodsInertb = jsonConvert.convert<int>(json['goods_inertb']);
  if (goodsInertb != null) {
    cateslideGroupEntity.goodsInertb = goodsInertb;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    cateslideGroupEntity.size = size;
  }
  final bool? showTitle = jsonConvert.convert<bool>(json['show_title']);
  if (showTitle != null) {
    cateslideGroupEntity.showTitle = showTitle;
  }
  final String? imageStyle2 = jsonConvert.convert<String>(json['image_style2']);
  if (imageStyle2 != null) {
    cateslideGroupEntity.imageStyle2 = imageStyle2;
  }
  final int? goodsTop2 = jsonConvert.convert<int>(json['goods_top2']);
  if (goodsTop2 != null) {
    cateslideGroupEntity.goodsTop2 = goodsTop2;
  }
  final int? pageMarginTop = jsonConvert.convert<int>(json['page_margin_top']);
  if (pageMarginTop != null) {
    cateslideGroupEntity.pageMarginTop = pageMarginTop;
  }
  final String? titleSize = jsonConvert.convert<String>(json['title_size']);
  if (titleSize != null) {
    cateslideGroupEntity.titleSize = titleSize;
  }
  final String? imageFillStyle = jsonConvert.convert<String>(json['image_fill_style']);
  if (imageFillStyle != null) {
    cateslideGroupEntity.imageFillStyle = imageFillStyle;
  }
  final int? scale = jsonConvert.convert<int>(json['scale']);
  if (scale != null) {
    cateslideGroupEntity.scale = scale;
  }
  final String? boxShadowcolor = jsonConvert.convert<String>(json['box_shadowcolor']);
  if (boxShadowcolor != null) {
    cateslideGroupEntity.boxShadowcolor = boxShadowcolor;
  }
  final String? textStyleType = jsonConvert.convert<String>(json['text_style_type']);
  if (textStyleType != null) {
    cateslideGroupEntity.textStyleType = textStyleType;
  }
  final String? tipBgcolor = jsonConvert.convert<String>(json['tip_bgcolor']);
  if (tipBgcolor != null) {
    cateslideGroupEntity.tipBgcolor = tipBgcolor;
  }
  final String? imageStyle = jsonConvert.convert<String>(json['image_style']);
  if (imageStyle != null) {
    cateslideGroupEntity.imageStyle = imageStyle;
  }
  final int? tipPos = jsonConvert.convert<int>(json['tip_pos']);
  if (tipPos != null) {
    cateslideGroupEntity.tipPos = tipPos;
  }
  final String? titleColor = jsonConvert.convert<String>(json['title_color']);
  if (titleColor != null) {
    cateslideGroupEntity.titleColor = titleColor;
  }
  final String? bgOpcolor = jsonConvert.convert<String>(json['bg_opcolor']);
  if (bgOpcolor != null) {
    cateslideGroupEntity.bgOpcolor = bgOpcolor;
  }
  final int? btnRdx = jsonConvert.convert<int>(json['btn_rdx']);
  if (btnRdx != null) {
    cateslideGroupEntity.btnRdx = btnRdx;
  }
  final String? primod = jsonConvert.convert<String>(json['primod']);
  if (primod != null) {
    cateslideGroupEntity.primod = primod;
  }
  final int? goodsMargin = jsonConvert.convert<int>(json['goods_margin']);
  if (goodsMargin != null) {
    cateslideGroupEntity.goodsMargin = goodsMargin;
  }
  final int? pageMarginLeft = jsonConvert.convert<int>(json['page_margin_left']);
  if (pageMarginLeft != null) {
    cateslideGroupEntity.pageMarginLeft = pageMarginLeft;
  }
  final int? goodsBottom = jsonConvert.convert<int>(json['goods_bottom']);
  if (goodsBottom != null) {
    cateslideGroupEntity.goodsBottom = goodsBottom;
  }
  final String? bgColor = jsonConvert.convert<String>(json['bg_color']);
  if (bgColor != null) {
    cateslideGroupEntity.bgColor = bgColor;
  }
  final int? goodsBottom2 = jsonConvert.convert<int>(json['goods_bottom2']);
  if (goodsBottom2 != null) {
    cateslideGroupEntity.goodsBottom2 = goodsBottom2;
  }
  final int? radiusNum = jsonConvert.convert<int>(json['radius_num']);
  if (radiusNum != null) {
    cateslideGroupEntity.radiusNum = radiusNum;
  }
  final int? pageMarginIner = jsonConvert.convert<int>(json['page_margin_iner']);
  if (pageMarginIner != null) {
    cateslideGroupEntity.pageMarginIner = pageMarginIner;
  }
  final String? boxShadowcolor2 = jsonConvert.convert<String>(json['box_shadowcolor2']);
  if (boxShadowcolor2 != null) {
    cateslideGroupEntity.boxShadowcolor2 = boxShadowcolor2;
  }
  final bool? showZz = jsonConvert.convert<bool>(json['show_zz']);
  if (showZz != null) {
    cateslideGroupEntity.showZz = showZz;
  }
  final String? slideSetting = jsonConvert.convert<String>(json['slide_setting']);
  if (slideSetting != null) {
    cateslideGroupEntity.slideSetting = slideSetting;
  }
  final bool? showBd = jsonConvert.convert<bool>(json['show_bd']);
  if (showBd != null) {
    cateslideGroupEntity.showBd = showBd;
  }
  final String? tipBgcolorend = jsonConvert.convert<String>(json['tip_bgcolorend']);
  if (tipBgcolorend != null) {
    cateslideGroupEntity.tipBgcolorend = tipBgcolorend;
  }
  return cateslideGroupEntity;
}

Map<String, dynamic> $CateslideGroupEntityToJson(CateslideGroupEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['title_color2'] = entity.titleColor2;
  data['goods_lr'] = entity.goodsLr;
  data['display_scale'] = entity.displayScale;
  data['rdx'] = entity.rdx;
  data['text_align_type'] = entity.textAlignType;
  data['bg_image'] = entity.bgImage?.toJson();
  data['uuid'] = entity.uuid;
  data['bg_color2'] = entity.bgColor2;
  data['txt_mod_2'] = entity.txtMod2;
  data['txt_mod_1'] = entity.txtMod1;
  data['page_margin_right'] = entity.pageMarginRight;
  data['goods_inerlr'] = entity.goodsInerlr;
  data['sub_entry'] = entity.subEntry?.map((v) => v.toJson()).toList();
  data['per'] = entity.per;
  data['size_a'] = entity.sizeA;
  data['page_margin_bottom'] = entity.pageMarginBottom;
  data['title_bgcolor'] = entity.titleBgcolor;
  data['imgw'] = entity.imgw;
  data['sub_a'] = entity.subA;
  data['border_radius_type'] = entity.borderRadiusType;
  data['goods_inertb'] = entity.goodsInertb;
  data['size'] = entity.size;
  data['show_title'] = entity.showTitle;
  data['image_style2'] = entity.imageStyle2;
  data['goods_top2'] = entity.goodsTop2;
  data['page_margin_top'] = entity.pageMarginTop;
  data['title_size'] = entity.titleSize;
  data['image_fill_style'] = entity.imageFillStyle;
  data['scale'] = entity.scale;
  data['box_shadowcolor'] = entity.boxShadowcolor;
  data['text_style_type'] = entity.textStyleType;
  data['tip_bgcolor'] = entity.tipBgcolor;
  data['image_style'] = entity.imageStyle;
  data['tip_pos'] = entity.tipPos;
  data['title_color'] = entity.titleColor;
  data['bg_opcolor'] = entity.bgOpcolor;
  data['btn_rdx'] = entity.btnRdx;
  data['primod'] = entity.primod;
  data['goods_margin'] = entity.goodsMargin;
  data['page_margin_left'] = entity.pageMarginLeft;
  data['goods_bottom'] = entity.goodsBottom;
  data['bg_color'] = entity.bgColor;
  data['goods_bottom2'] = entity.goodsBottom2;
  data['radius_num'] = entity.radiusNum;
  data['page_margin_iner'] = entity.pageMarginIner;
  data['box_shadowcolor2'] = entity.boxShadowcolor2;
  data['show_zz'] = entity.showZz;
  data['slide_setting'] = entity.slideSetting;
  data['show_bd'] = entity.showBd;
  data['tip_bgcolorend'] = entity.tipBgcolorend;
  return data;
}

extension CateslideGroupEntityExtension on CateslideGroupEntity {
  CateslideGroupEntity copyWith({
    String? titleColor2,
    int? goodsLr,
    String? displayScale,
    int? rdx,
    String? textAlignType,
    CateslideGroupBgImage? bgImage,
    String? uuid,
    String? bgColor2,
    String? txtMod2,
    String? txtMod1,
    int? pageMarginRight,
    int? goodsInerlr,
    List<CateslideGroupSubEntry>? subEntry,
    int? per,
    int? sizeA,
    int? pageMarginBottom,
    String? titleBgcolor,
    int? imgw,
    int? subA,
    String? borderRadiusType,
    int? goodsInertb,
    int? size,
    bool? showTitle,
    String? imageStyle2,
    int? goodsTop2,
    int? pageMarginTop,
    String? titleSize,
    String? imageFillStyle,
    int? scale,
    String? boxShadowcolor,
    String? textStyleType,
    String? tipBgcolor,
    String? imageStyle,
    int? tipPos,
    String? titleColor,
    String? bgOpcolor,
    int? btnRdx,
    String? primod,
    int? goodsMargin,
    int? pageMarginLeft,
    int? goodsBottom,
    String? bgColor,
    int? goodsBottom2,
    int? radiusNum,
    int? pageMarginIner,
    String? boxShadowcolor2,
    bool? showZz,
    String? slideSetting,
    bool? showBd,
    String? tipBgcolorend,
  }) {
    return CateslideGroupEntity()
      ..titleColor2 = titleColor2 ?? this.titleColor2
      ..goodsLr = goodsLr ?? this.goodsLr
      ..displayScale = displayScale ?? this.displayScale
      ..rdx = rdx ?? this.rdx
      ..textAlignType = textAlignType ?? this.textAlignType
      ..bgImage = bgImage ?? this.bgImage
      ..uuid = uuid ?? this.uuid
      ..bgColor2 = bgColor2 ?? this.bgColor2
      ..txtMod2 = txtMod2 ?? this.txtMod2
      ..txtMod1 = txtMod1 ?? this.txtMod1
      ..pageMarginRight = pageMarginRight ?? this.pageMarginRight
      ..goodsInerlr = goodsInerlr ?? this.goodsInerlr
      ..subEntry = subEntry ?? this.subEntry
      ..per = per ?? this.per
      ..sizeA = sizeA ?? this.sizeA
      ..pageMarginBottom = pageMarginBottom ?? this.pageMarginBottom
      ..titleBgcolor = titleBgcolor ?? this.titleBgcolor
      ..imgw = imgw ?? this.imgw
      ..subA = subA ?? this.subA
      ..borderRadiusType = borderRadiusType ?? this.borderRadiusType
      ..goodsInertb = goodsInertb ?? this.goodsInertb
      ..size = size ?? this.size
      ..showTitle = showTitle ?? this.showTitle
      ..imageStyle2 = imageStyle2 ?? this.imageStyle2
      ..goodsTop2 = goodsTop2 ?? this.goodsTop2
      ..pageMarginTop = pageMarginTop ?? this.pageMarginTop
      ..titleSize = titleSize ?? this.titleSize
      ..imageFillStyle = imageFillStyle ?? this.imageFillStyle
      ..scale = scale ?? this.scale
      ..boxShadowcolor = boxShadowcolor ?? this.boxShadowcolor
      ..textStyleType = textStyleType ?? this.textStyleType
      ..tipBgcolor = tipBgcolor ?? this.tipBgcolor
      ..imageStyle = imageStyle ?? this.imageStyle
      ..tipPos = tipPos ?? this.tipPos
      ..titleColor = titleColor ?? this.titleColor
      ..bgOpcolor = bgOpcolor ?? this.bgOpcolor
      ..btnRdx = btnRdx ?? this.btnRdx
      ..primod = primod ?? this.primod
      ..goodsMargin = goodsMargin ?? this.goodsMargin
      ..pageMarginLeft = pageMarginLeft ?? this.pageMarginLeft
      ..goodsBottom = goodsBottom ?? this.goodsBottom
      ..bgColor = bgColor ?? this.bgColor
      ..goodsBottom2 = goodsBottom2 ?? this.goodsBottom2
      ..radiusNum = radiusNum ?? this.radiusNum
      ..pageMarginIner = pageMarginIner ?? this.pageMarginIner
      ..boxShadowcolor2 = boxShadowcolor2 ?? this.boxShadowcolor2
      ..showZz = showZz ?? this.showZz
      ..slideSetting = slideSetting ?? this.slideSetting
      ..showBd = showBd ?? this.showBd
      ..tipBgcolorend = tipBgcolorend ?? this.tipBgcolorend;
  }
}

CateslideGroupBgImage $CateslideGroupBgImageFromJson(Map<String, dynamic> json) {
  final CateslideGroupBgImage cateslideGroupBgImage = CateslideGroupBgImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    cateslideGroupBgImage.attachmentUrl = attachmentUrl;
  }
  return cateslideGroupBgImage;
}

Map<String, dynamic> $CateslideGroupBgImageToJson(CateslideGroupBgImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension CateslideGroupBgImageExtension on CateslideGroupBgImage {
  CateslideGroupBgImage copyWith({
    String? attachmentUrl,
  }) {
    return CateslideGroupBgImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}

CateslideGroupSubEntry $CateslideGroupSubEntryFromJson(Map<String, dynamic> json) {
  final CateslideGroupSubEntry cateslideGroupSubEntry = CateslideGroupSubEntry();
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    cateslideGroupSubEntry.linkType = linkType;
  }
  final String? imageUrl = jsonConvert.convert<String>(json['image_url']);
  if (imageUrl != null) {
    cateslideGroupSubEntry.imageUrl = imageUrl;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    cateslideGroupSubEntry.linkTitle = linkTitle;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    cateslideGroupSubEntry.title = title;
  }
  final int? linkId = jsonConvert.convert<int>(json['link_id']);
  if (linkId != null) {
    cateslideGroupSubEntry.linkId = linkId;
  }
  final String? desc = jsonConvert.convert<String>(json['desc']);
  if (desc != null) {
    cateslideGroupSubEntry.desc = desc;
  }
  return cateslideGroupSubEntry;
}

Map<String, dynamic> $CateslideGroupSubEntryToJson(CateslideGroupSubEntry entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['link_type'] = entity.linkType;
  data['image_url'] = entity.imageUrl;
  data['link_title'] = entity.linkTitle;
  data['title'] = entity.title;
  data['link_id'] = entity.linkId;
  data['desc'] = entity.desc;
  return data;
}

extension CateslideGroupSubEntryExtension on CateslideGroupSubEntry {
  CateslideGroupSubEntry copyWith({
    String? linkType,
    String? imageUrl,
    String? linkTitle,
    String? title,
    int? linkId,
    String? desc,
  }) {
    return CateslideGroupSubEntry()
      ..linkType = linkType ?? this.linkType
      ..imageUrl = imageUrl ?? this.imageUrl
      ..linkTitle = linkTitle ?? this.linkTitle
      ..title = title ?? this.title
      ..linkId = linkId ?? this.linkId
      ..desc = desc ?? this.desc;
  }
}
